package com.geekchique.runningbuddy.view;

import android.view.View;
import android.widget.Button;

import com.geekchique.runningbuddy.controller.MapOfJogControllerImpl;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class MapOfJogView {

	@SuppressWarnings("unused")
	private MapActivity mapActivity;
	private MapOfJogControllerImpl mapOfJogController;
	public MapView mapView;

	public MapOfJogView(MapActivity mapActivity, MapOfJogControllerImpl mapOfJogControllerImpl, Button goButton, MapView mapView) {
		this.mapActivity = mapActivity;
		this.mapView = mapView;
		this.mapOfJogController = mapOfJogControllerImpl;
	      
		goButton.setOnClickListener(GoClickListener);
	}

	public void invalidateMapView(){
		this.mapView.invalidate();
	}
      
	public void toggleSatellite(){
		this.mapView.toggleSatellite();
	}
      
	public boolean isSatellite(){
		return this.mapView.isSatellite();
	}

	View.OnClickListener GoClickListener = new View.OnClickListener() {
		public void onClick(View arg0) {
			mapOfJogController.gotoCurrentGPSPosition();
		}
	};

	public int getZoomLevel() {
		return this.mapView.getZoomLevel();
	}

}
